package com.matrix.java.chap_06;

import java.util.Scanner;

/*
    将毫秒数转换成小时数、分钟数和秒数
 */
public class Ex6_25 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("输入: ");
        long totalMilliSeconds = input.nextLong();
        input.close();
        System.out.println(convertMillis(totalMilliSeconds));
    }

    private static String convertMillis(long millis) {
        String timeStr;
        long second = millis / 1000;
        long minutes = second / 60;
        long hours = minutes / 60;
        timeStr = hours + ":" + minutes % 60 + ":" + second % 60;
        return timeStr;
    }
}
